import request from '@/utils/request'
let URL= 'base-platform'
// let URL= ''

//查询部门树
export function tree(query) {
  return request({
    url: URL + '/v2/base/department/tree',
    method: 'get',
    params: query
  })
}

//获取的部门树与教师列表
export function allTeacherAndTree(query) {
  return request({
    url: URL + '/v2/base/department/allTeacherAndTree',
    method: 'get',
    params: query
  })
}

//获取的部门树与教师列表 复杂参数 见 http://47.96.232.83:8080/base-platform/doc.html
export function allTeacherAndTreeP(data) {
  return request({
    url: URL + '/v2/base/department/allTeacherAndTree',
    method: 'post',
    data: {
      "isUserPresenceDepartment": true,
      "userIndex": []
    }
  })
}

//获取的部门树与教师列表 复杂参数 见 http://47.96.232.83:8080/base-platform/doc.html
export function teacherList(query) {
  return request({
    url: URL + '/v2/base/teacher/list',
    method: 'get',
    params: query
  })
}

//校历
export function calendarInfo(query) {
  return request({
    url: URL + '/v2/base/calendar/info',
    method: 'get',
    params: query
  })
}

//通过id删除考勤组-考勤负责人
export function oaattendancegroupleader(query) {
  return request({
    url: URL + '/v1/oaattendancegroupleader',
    method: 'delete',
    params: query
  })
}


//通过id查询-基本信息
export function getBase(id) {
  return request({
    url: URL + '/v1/attgroup/base/' + id,
    method: 'get',
  })
}

//保存考勤组-基本信息
export function save(data) {
  return request({
    url: URL + '/v1/attgroup/base/save',
    method: 'post',
    data
  })
}
